home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / grphwiz.dxr / 00115_paste button.ls < prev    next >
Encoding:
Text File  |  2000-01-14  |  1.7 KB  |  69 lines

  1. property ancestor, pMIAW, pCursor
  2. global gEnvironObj, gDataTooBigAlert, gTableClipboard, gIsRolloverTextOn
  3.  
  4. on new me, buttonName, castName, theChannel, theStageLoc, theBalloonChannel, theBalloonLoc, descendant
  5.   if objectp(descendant) then
  6.     ancestor = new(script("button with balloon"), buttonName, castName, theChannel, theStageLoc, theBalloonChannel, theBalloonLoc, descendant)
  7.   else
  8.     ancestor = new(script("button with balloon"), buttonName, castName, theChannel, theStageLoc, theBalloonChannel, theBalloonLoc, me)
  9.   end if
  10.   pCursor = [member("point hand", "graph.cst"), member("point hand mask", "graph.cst")]
  11.   return me
  12. end
  13.  
  14. on enable me
  15.   if listp(gTableClipboard) then
  16.     enable(ancestor)
  17.     set the cursor of sprite the pChannel of me to pCursor
  18.   end if
  19.   return me
  20. end
  21.  
  22. on disable me
  23.   disable(ancestor)
  24.   set the cursor of sprite the pChannel of me to -1
  25. end
  26.  
  27. on setMIAW me, miaw
  28.   pMIAW = miaw
  29.   return me
  30. end
  31.  
  32. on performFunction me
  33.   if listp(gTableClipboard) then
  34.     isDataTooBig = 0
  35.     if checkIfSelected(getTable(pMIAW)) then
  36.       tell the stage
  37.         playSFX(5)
  38.       end tell
  39.       if checkPasteDataSize(getTable(pMIAW), gTableClipboard) then
  40.         setSelectedData(getTable(pMIAW), gTableClipboard)
  41.       else
  42.         isDataTooBig = 1
  43.       end if
  44.     else
  45.       beep()
  46.     end if
  47.     if isDataTooBig then
  48.       tell the stage
  49.         openAlertWindow("badpaste", rect(0, 0, 320, 171))
  50.       end tell
  51.     end if
  52.   end if
  53.   return me
  54. end
  55.  
  56. on performRolloverFunction me
  57.   if gIsRolloverTextOn then
  58.     performRolloverFunction(ancestor)
  59.   end if
  60.   return me
  61. end
  62.  
  63. on performRolloffFunction me
  64.   if gIsRolloverTextOn then
  65.     performRolloffFunction(ancestor)
  66.   end if
  67.   return me
  68. end
  69.